package models;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author eagle_eye
 */
@Entity
@Table(name = "TELEFONOS", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Telefonos.findAll", query = "SELECT t FROM Telefonos t"),
    @NamedQuery(name = "Telefonos.findByIdTelefonos", query = "SELECT t FROM Telefonos t WHERE t.idTelefonos = :idTelefonos"),
    @NamedQuery(name = "Telefonos.findByTipoTelefono", query = "SELECT t FROM Telefonos t WHERE t.tipoTelefono = :tipoTelefono"),
    @NamedQuery(name = "Telefonos.findByTelefono", query = "SELECT t FROM Telefonos t WHERE t.telefono = :telefono")})
public class Telefonos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idTelefonos", nullable = false)
    private Integer idTelefonos;
    @Column(name = "tipoTelefono", length = 32)
    private String tipoTelefono;
    @Column(name = "telefono", length = 32)
    private String telefono;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "telefonosId")
    private List<Profesor> profesorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "telefonosId")
    private List<Estudiante> estudianteList;

    public Telefonos() {
    }

    public Telefonos(Integer idTelefonos) {
        this.idTelefonos = idTelefonos;
    }

    public Integer getIdTelefonos() {
        return idTelefonos;
    }

    public void setIdTelefonos(Integer idTelefonos) {
        this.idTelefonos = idTelefonos;
    }

    public String getTipoTelefono() {
        return tipoTelefono;
    }

    public void setTipoTelefono(String tipoTelefono) {
        this.tipoTelefono = tipoTelefono;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public List<Profesor> getProfesorList() {
        return profesorList;
    }

    public void setProfesorList(List<Profesor> profesorList) {
        this.profesorList = profesorList;
    }

    public List<Estudiante> getEstudianteList() {
        return estudianteList;
    }

    public void setEstudianteList(List<Estudiante> estudianteList) {
        this.estudianteList = estudianteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTelefonos != null ? idTelefonos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Telefonos)) {
            return false;
        }
        Telefonos other = (Telefonos) object;
        if ((this.idTelefonos == null && other.idTelefonos != null) || (this.idTelefonos != null && !this.idTelefonos.equals(other.idTelefonos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Telefonos[idTelefonos=" + idTelefonos + "]";
    }

}
